/*
 * @Author: liuzelin
 * @Date: 2024-04-06 20:30:47
 * @LastEditors: liuzelin
 * @LastEditTime: 2024-05-01 10:40:27
 * @Description: file content
 */

#pragma once
#include <stdint.h>

namespace Panda {
#pragma pack(push, 1)
enum ExpandType : uint8_t {
  SessionConfigure,
  TransportFeedback,
};

struct ExpandBase
{
  uint8_t type;
  uint8_t len;
};

struct SessionConfigure {
  struct ExpandBase base {
    ExpandType::SessionConfigure, sizeof(struct SessionConfigure)
  };
  uint8_t sid[4];
  uint8_t is_order : 1;
  uint8_t is_reliable : 1;
  uint8_t enable_time_out_retrans : 1;
  uint8_t padding : 5;
  uint8_t max_retrans_num[2];
  uint8_t max_retrans_time[2];
};

struct TransportFeedback {
  struct ExpandBase base {
    ExpandType::TransportFeedback, sizeof(struct TransportFeedback)
  };
  uint8_t ack_band_width[4];
  uint8_t loss_rate;
};
#pragma pack(pop)

}  // namespace Panda